import {
    totalConfig,
    propName
} from 'server/config/templateConfig';
import utils from 'server/core/utils';
let cardConfig = totalConfig.card;

//调查有1可能遇到怪-发现物品,2获得东西或者武器,3触发任务事件,4获得解密信息

class DialogueHandle {
    static getInstance() {
        if (!DialogueHandle.instance) {
            DialogueHandle.instance = new DialogueHandle();
        }
        return DialogueHandle.instance;
    }

    do(cardId) {
        let cardConfigInfo = cardConfig[cardId];
        let dialogue = cardConfigInfo.dialogue;
        let dialogueType = dialogue.type;
        if (dialogueType === 1) {
            
        } else if (eventType === 2) {
            let random = Math.random() * 100;
            let itemId = null;
            for (let value of event.items) {
                if (random < value[1]) {
                    itemId = value[0];
                    break;
                }
            }
            return {
                eventType: eventType,
                items: [
                    [itemId, 1]
                ]
            };
        }
    }

}

export default DialogueHandle.getInstance();